package GUI_Abs;

import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Toolkit;

import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.SwingConstants;
import javax.swing.JPanel;
import java.awt.Color;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class hhacGui {

	private JFrame frame;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					hhacGui window = new hhacGui();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public hhacGui() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.getContentPane().setBackground(Color.RED);
		Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
		//screen.width=1040;
		//screen.height=720;
		frame.setBounds(0,0,screen.width,screen.height);
		frame.setUndecorated(true); //maximized
		
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().setLayout(null);
		
		JLabel lblTitle = new JLabel("HH Academic Bowl");
		lblTitle.setHorizontalAlignment(SwingConstants.LEFT);
		lblTitle.setFont(new Font("Impact", Font.PLAIN, 69));
		lblTitle.setBounds((frame.getWidth()-525)/2, 10, 525, 68); //title position
		frame.getContentPane().add(lblTitle);
		
		JPanel gamePanel = new JPanel();
		gamePanel.setForeground(Color.BLACK);
		gamePanel.setBackground(Color.RED);
		gamePanel.setBounds(65, (lblTitle.getY() + lblTitle.getHeight() + 10), (frame.getWidth()-65*2), (frame.getHeight()-65*2));
		frame.getContentPane().add(gamePanel);
		gamePanel.setLayout(null);
		
		
		int categoryWidth = ((gamePanel.getWidth()-60)/5);
		
		//-----------Panel 1----------------//
		final JPanel categoryPanel_1 = new JPanel();
		categoryPanel_1.setBackground(Color.RED);
		categoryPanel_1.setBounds(10, 0, categoryWidth, gamePanel.getHeight());
		gamePanel.add(categoryPanel_1);
		categoryPanel_1.setLayout(null);
		
		JLabel lblCategory_1 = new JLabel("Category 1");
		lblCategory_1.setHorizontalAlignment(SwingConstants.CENTER);
		lblCategory_1.setBounds(0, 0, categoryWidth, 38);
		lblCategory_1.setFont(new Font("Impact", Font.PLAIN, 30));
		categoryPanel_1.add(lblCategory_1);
		
		int buttonBuffer = (categoryPanel_1.getHeight() - (38) - (85*5) )/5;
		
		JButton btnC1_10 = new JButton("10");
		btnC1_10.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				categoryPanel_1.getComponent(1).setVisible(false);  //TODO MORE. F****** COPY. PASTA. F***.
			}
		});
		btnC1_10.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC1_10.setBounds(10, ((lblCategory_1.getY() +lblCategory_1.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_1.add(btnC1_10);
		
		JButton btnC1_20 = new JButton("20");
		btnC1_20.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC1_20.setBounds(10, ((btnC1_10.getY() + btnC1_10.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_1.add(btnC1_20);
		
		JButton btnC1_30 = new JButton("30");
		btnC1_30.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC1_30.setBounds(10, ((btnC1_20.getY() + btnC1_20.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_1.add(btnC1_30);
		
		JButton btnC1_40 = new JButton("40");
		btnC1_40.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC1_40.setBounds(10, ((btnC1_30.getY() + btnC1_30.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_1.add(btnC1_40);
		
		JButton btnC1_50 = new JButton("50");
		btnC1_50.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC1_50.setBounds(10, ((btnC1_40.getY() + btnC1_40.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_1.add(btnC1_50);
		
		//-----------Panel 2----------------//
		final JPanel categoryPanel_2 = new JPanel();
		categoryPanel_2.setBackground(Color.RED);
		categoryPanel_2.setBounds( categoryPanel_2.getX()+categoryWidth+10, 0, categoryWidth, gamePanel.getHeight());
		gamePanel.add(categoryPanel_2);
		categoryPanel_2.setLayout(null);
		
		JLabel lblCategory_2 = new JLabel("Category 2");
		lblCategory_2.setHorizontalAlignment(SwingConstants.CENTER);
		lblCategory_2.setBounds(0, 0, categoryWidth, 38);
		lblCategory_2.setFont(new Font("Impact", Font.PLAIN, 30));
		categoryPanel_2.add(lblCategory_2);
		
		JButton btnC2_10 = new JButton("10");
		btnC2_10.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC2_10.setBounds(10, ((lblCategory_2.getY() +lblCategory_2.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_2.add(btnC2_10);
		
		JButton btnC2_20 = new JButton("20");
		btnC2_20.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC2_20.setBounds(10, ((btnC2_10.getY() + btnC2_10.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_2.add(btnC2_20);
		
		JButton btnC2_30 = new JButton("30");
		btnC2_30.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC2_30.setBounds(10, ((btnC2_20.getY() + btnC2_20.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_2.add(btnC2_30);
		
		JButton btnC2_40 = new JButton("40");
		btnC2_40.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC2_40.setBounds(10, ((btnC2_30.getY() + btnC2_30.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_2.add(btnC2_40);
		
		JButton btnC2_50 = new JButton("50");
		btnC2_50.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC2_50.setBounds(10, ((btnC2_40.getY() + btnC2_40.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_2.add(btnC2_50);
		
		//-----------Panel 3----------------//
		final JPanel categoryPanel_3 = new JPanel();
		categoryPanel_3.setBackground(Color.RED);
		categoryPanel_3.setBounds( categoryPanel_2.getX()+categoryWidth+10, 0, categoryWidth, gamePanel.getHeight());
		gamePanel.add(categoryPanel_3);
		categoryPanel_3.setLayout(null);
		
		JLabel lblCategory_3 = new JLabel("Category 3");
		lblCategory_3.setHorizontalAlignment(SwingConstants.CENTER);
		lblCategory_3.setBounds(0, 0, categoryWidth, 38);
		lblCategory_3.setFont(new Font("Impact", Font.PLAIN, 30));
		categoryPanel_3.add(lblCategory_3);
		
		JButton btnC3_10 = new JButton("10");
		btnC3_10.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC3_10.setBounds(10, ((lblCategory_3.getY() +lblCategory_3.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_3.add(btnC3_10);
		
		JButton btnC3_20 = new JButton("20");
		btnC3_20.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC3_20.setBounds(10, ((btnC3_10.getY() + btnC3_10.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_3.add(btnC3_20);
		
		JButton btnC3_30 = new JButton("30");
		btnC3_30.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC3_30.setBounds(10, ((btnC3_20.getY() + btnC3_20.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_3.add(btnC3_30);
		
		JButton btnC3_40 = new JButton("40");
		btnC3_40.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC3_40.setBounds(10, ((btnC3_30.getY() + btnC3_30.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_3.add(btnC3_40);
		
		JButton btnC3_50 = new JButton("50");
		btnC3_50.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC3_50.setBounds(10, ((btnC3_40.getY() + btnC3_40.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_3.add(btnC3_50);
		
		//-----------Panel 4----------------//
		final JPanel categoryPanel_4 = new JPanel();
		categoryPanel_4.setBackground(Color.RED);
		categoryPanel_4.setBounds( categoryPanel_3.getX()+categoryWidth+10, 0, categoryWidth, gamePanel.getHeight());
		gamePanel.add(categoryPanel_4);
		categoryPanel_4.setLayout(null);
		
		JLabel lblCategory_4 = new JLabel("Category 4");
		lblCategory_4.setHorizontalAlignment(SwingConstants.CENTER);
		lblCategory_4.setBounds(0, 0, categoryWidth, 38);
		lblCategory_4.setFont(new Font("Impact", Font.PLAIN, 30));
		categoryPanel_4.add(lblCategory_4);
		
		JButton btnC4_10 = new JButton("10");
		btnC4_10.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC4_10.setBounds(10, ((lblCategory_4.getY() +lblCategory_4.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_4.add(btnC4_10);
		
		JButton btnC4_20 = new JButton("20");
		btnC4_20.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC4_20.setBounds(10, ((btnC4_10.getY() + btnC4_10.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_4.add(btnC4_20);
		
		JButton btnC4_30 = new JButton("30");
		btnC4_30.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC4_30.setBounds(10, ((btnC4_20.getY() + btnC4_20.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_4.add(btnC4_30);
		
		JButton btnC4_40 = new JButton("40");
		btnC4_40.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC4_40.setBounds(10, ((btnC4_30.getY() + btnC4_30.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_4.add(btnC4_40);
		
		JButton btnC4_50 = new JButton("50");
		btnC4_50.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC4_50.setBounds(10, ((btnC4_40.getY() + btnC4_40.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_4.add(btnC4_50);
		
		//-----------Panel 5----------------//
		final JPanel categoryPanel_5 = new JPanel();
		categoryPanel_5.setBackground(Color.RED);
		categoryPanel_5.setBounds( categoryPanel_4.getX()+categoryWidth+10, 0, categoryWidth, gamePanel.getHeight());
		gamePanel.add(categoryPanel_5);
		categoryPanel_5.setLayout(null);
		
		JLabel lblCategory_5 = new JLabel("Category 4");
		lblCategory_5.setHorizontalAlignment(SwingConstants.CENTER);
		lblCategory_5.setBounds(0, 0, categoryWidth, 38);
		lblCategory_5.setFont(new Font("Impact", Font.PLAIN, 30));
		categoryPanel_5.add(lblCategory_5);
		
		JButton btnC5_10 = new JButton("10");
		btnC5_10.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC5_10.setBounds(10, ((lblCategory_5.getY() +lblCategory_5.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_5.add(btnC5_10);
		
		JButton btnC5_20 = new JButton("20");
		btnC5_20.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC5_20.setBounds(10, ((btnC5_10.getY() + btnC5_10.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_5.add(btnC5_20);
		
		JButton btnC5_30 = new JButton("30");
		btnC5_30.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC5_30.setBounds(10, ((btnC5_20.getY() + btnC5_20.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_5.add(btnC5_30);
		
		JButton btnC5_40 = new JButton("40");
		btnC5_40.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC5_40.setBounds(10, ((btnC5_30.getY() + btnC5_30.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_5.add(btnC5_40);
		
		JButton btnC5_50 = new JButton("50");
		btnC5_50.setFont(new Font("Impact", Font.PLAIN, 22));
		btnC5_50.setBounds(10, ((btnC5_40.getY() + btnC5_40.getHeight()) + buttonBuffer), 198, 85);
		categoryPanel_5.add(btnC5_50);
	}
}
